package com.hornsun.domain.constant.types;

/**
 * Created by 编译中... on 2018/4/24.
 */
public enum OrderType {
    UNPAID(1,"待付款"),
    UNCONFIRMED(2,"待发货"),
    DELIVER_GOODS(3,"已发货"),
    FINISH(4,"已完成"),
    CANCEL(5,"已取消");

    private Integer type;
    private String name;

    OrderType(Integer type ,String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static OrderType fromName(String name) {
        for (OrderType orderType : values()) {
            if (orderType.name.equals(name) ) {
                return orderType;
            }
        }
        return null;
    }
}
